<template>
    <a-modal class="modelAll" :width="1200" :footer="null" :visible="visible" title="" @ok="handleOk"
        @cancel="handleClose" centered :zIndex="1010">
        <a-tabs v-model:activeKey="activeKey">
            <a-tab-pane key="1" tab="项目素材">
                <newChooseMaContent v-if="visible" @onsubmit="onsubmit" @closepage="closepage" :modelType="modelType" 
                    :is_merchant_library="activeKey" :isClip="isClip" />
            </a-tab-pane>
            <a-tab-pane key="0" tab="通用素材">
                <newChooseMaContent v-if="visible" @onsubmit="onsubmit" @closepage="closepage" :modelType="modelType" 
                :is_merchant_library="activeKey" :isClip="isClip" />

            </a-tab-pane>
        </a-tabs>
    </a-modal>
</template>

<script setup>
import { ref, defineEmits, defineProps, watch } from "vue";
import newChooseMaContent from "./newChooseMaContent.vue";

const emit = defineEmits(["change", 'close' ]);
const props = defineProps({
    modelType: {
        type: String,
        default: ''
    },
    isClip: {
        type: Boolean,
        default: 'false'
    },
    visible: {
        type: Boolean,
        default: 'false'
    }
})
const activeKey = ref("1")
// const visible = ref(true)

const handleClose = () => {
    emit("close", submitData.value);
}

const closepage = () => {
    emit("close");

}



const submitData = ref([])
const onsubmit = (data) => {
    submitData.value = data
    handleClose()

}


</script>

<style lang="less" scoped>
.modelAll {
    // min-height: 676px;
}
</style>